package util;

import javax.inject.Inject;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

import bean.ActiveSessionsStoreBean;

@WebListener
public class UserSessionListener implements HttpSessionListener {
	
	@Inject
	ActiveSessionsStoreBean sessionsStore;
	 
	@Override
    public void sessionCreated(HttpSessionEvent event) { }
 
	@Override
    public void sessionDestroyed(HttpSessionEvent event) {
    	sessionsStore.removeSession(event.getSession());
    }
 
}